﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace CarterWechatServer.DataEntity.Entities
{
    /// <summary>
    /// 订单实体类
    /// </summary>

    [Table("Order")]
    public class OrderEntity
    {
        /// <summary>
        /// Id
        /// </summary>
        [Key]
        public int Id { get; set; }

        /// <summary>
        /// 下单时间
        /// </summary>
        public DateTime OrderTime { get; set; }

        /// <summary>
        /// 用户Id
        /// </summary>
        [ForeignKey("User")]
        public int UserId { get; set; }

        /// <summary>
        /// 菜品总数量
        /// </summary>
        public int TotalCount { get; set; }

        /// <summary>
        /// 订单总金额
        /// </summary>
        public int TotalAmount { get; set; }

        /// <summary>
        /// 订单状态(1.未付款  2.支付成功)
        /// </summary>
        public int OrderStatus { get; set; }

        /// <summary>
        /// 系统订单号
        /// </summary>
        public string OrderCode { get; set; }

        /// <summary>
        /// 微信订单号
        /// </summary>
        public string WechatOrderCode { get; set; }

        /// <summary>
        /// 取餐号
        /// </summary>
        public int TakeNo { get; set; }

        public virtual UserEntity User { get; set; }

        public virtual ICollection<OrderInfoEntity> OrderInfo { get; set; }
    }
}
